package com.atguigu.acl.controller;


import com.atguigu.acl.entity.Permission;
import com.atguigu.acl.service.PermissionService;
import com.atguigu.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 权限 前端控制器
 * </p>
 *
 * @author admin
 * @since 2020-07-18
 */
@RestController
@Api(value = "", description = "获取权限")
@RequestMapping("/acl/permission")
public class PermissionController {
    @Autowired
    PermissionService permissionService;

    //递归查菜单
    @ApiOperation("获取权限菜单")
    @GetMapping
    public R getAllPermission() {
        List<Permission> list = permissionService.getAllMenu();
        return R.ok().data("items", list);
    }
}

